import request from '@/utils/request'

// 获取路由配置列表
export function getRouteList(params) {
  return request({
    url: '/basic/web/route/list',
    method: 'get',
    params
  })
}

// 获取路由配置详情
export function getRouteDetail(id) {
  return request({
    url: `/basic/web/route/${id}`,
    method: 'get'
  })
}

// 新增路由配置
export function addRoute(data) {
  return request({
    url: '/basic/web/route',
    method: 'post',
    data
  })
}

// 修改路由配置
export function updateRoute(data) {
  return request({
    url: '/basic/web/route',
    method: 'put',
    data
  })
}

// 删除路由配置
export function deleteRoute(ids) {
  return request({
    url: `/basic/web/route/${ids}`,
    method: 'delete'
  })
}

// 获取页面类型下拉列表
export function getPageTypeList() {
  return request({
    url: '/basic/web/route/pageTypeList',
    method: 'get'
  })
}

// 获取HTTP请求方法下拉列表
export function getRequestMethodList() {
  return request({
    url: '/basic/web/route/requestMethodList',
    method: 'get'
  })
}

// 获取路由状态下拉列表
export function getRouteStatusList() {
  return request({
    url: '/basic/web/route/routeStatusList',
    method: 'get'
  })
}